<?php 
$this->headScript()->appendFile( $this->baseUrl() . '/public/js/ajaxupload/ajaxfileupload.js' );
$this->headScript()->appendFile( $this->baseUrl() . '/public/js/adminscript.js' );
$this->headScript()->appendScript( 
		'var baseUrl = "'.$this->baseUrl().'";'.
		'var photoUrl = "'.$this->baseUrl().'/public/images/box/";'
	);
?>

<table>
	<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpcategory">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
	</tr>
</table>

<h2><?php 
foreach ($this->langs as $one)
{
	if(isset($this->des[$one['l_id']]['title'])){
		echo "Edytuj ".$this->des[$one['l_id']]['title'];
	}else echo "Dodaj nową kategorię";	 
	break;
}
?></h2>
<form method="post" id="formitem" enctype="multipart/form-data">
	<table cellpadding="5" border="0" cellspacing="5"  class="tform">
		<tr>
			<td>Nazwa kategorii</td>
			<td width="70%">
				<?php 
				foreach ($this->langs as $one)
				{
					echo $one['name_long'].':<br />';
					echo $this->formText('title['.$one['l_id'].']', @$this->des[$one['l_id']]['title']).'<br />';			 
				}
				?>
			</td>
		</tr>
		<tr>
			<td>Przyjazny url (jeśli puste, uzupełni się automatycznie)</td>
			<td width="70%">
				<?php 
				foreach ($this->langs as $one)
				{
					echo $one['name_long'].':<br />';
					echo $this->formText('url['.$one['l_id'].']', @$this->des[$one['l_id']]['url']).'<br />';				 
				}
				?>
			</td>
		</tr>
	</table>
</form>
<table>
	<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpcategory">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
	</tr>
</table>